
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="flow/flow.css">
    <script type="text/javascript" src="<%=request.getContextPath()%>/static/jquery/jquery-1.11.0.min.js"></script>
</head>
<body>
<div id="demo2" style="margin:10px"></div>
<input id="submit" type="button" value='导出结果' onclick="Export()"/>
<textarea id="result" row="6"></textarea>
</body>
<script type="text/javascript" src="flow/flow.js"></script>
<script type="text/javascript">
    var jsondata={"title":"业务审批流程",
        "nodes":
            {"demo_node_1":{"name":"登记","left":20,"top":59,"type":"start round","width":24,"height":24},
                "demo_node_3":{"name":"分管领导批","left":335,"top":57,"type":"task","width":109,"height":40},
                "demo_node_6":{"name":"分件","left":73,"top":60,"type":"fork","width":100,"height":24},
                "demo_node_8":{"name":"XX科审批","left":172,"top":95,"type":"task","width":100,"height":24},
                "demo_node_9":{"name":"XX科审批","left":171,"top":25,"type":"task","width":100,"height":24},
                "demo_node_20":{"name":"局领导审批","left":333,"top":184,"type":"task","width":111,"height":49},
                "demo_node_23":{"name":"打证发件","left":172,"top":198,"type":"task","width":100,"height":24},
                "demo_node_25":{"name":"归档","left":17,"top":198,"type":"end round","width":24,"height":24}},
        "lines":
            {"demo_line_7":{"type":"sl","from":"demo_node_1","to":"demo_node_6","name":"","alt":true},
                "demo_line_10":{"type":"lr","M":121,"from":"demo_node_6","to":"demo_node_8","name":""},
                "demo_line_11":{"type":"lr","M":122,"from":"demo_node_6","to":"demo_node_9","name":""},
                "demo_line_12":{"type":"lr","M":312.5,"from":"demo_node_8","to":"demo_node_3","name":""},
                "demo_line_13":{"type":"lr","M":312.5,"from":"demo_node_9","to":"demo_node_3","name":""},
                "demo_line_21":{"type":"sl","from":"demo_node_3","to":"demo_node_20","name":""},
                "demo_line_24":{"type":"sl","from":"demo_node_20","to":"demo_node_23","name":""},
                "demo_line_26":{"type":"sl","from":"demo_node_23","to":"demo_node_25","name":""}},"areas":{},"initNum":28};
    var property={
        headLabel:true,
        initLabelText:"审批流程",
        width:800,
        height:400,
        toolBtns:["start round","end round","task","fork","join"],
        haveHead:true,
        headBtns:["save","undo","redo","reload"],//如果haveHead=true，则定义HEAD区的按钮
        haveTool:true,
        haveGroup:true,
        useOperStack:true
    };
    var remark={
        cursor:"选择指针",
        direct:"结点连线",
        start:"入口结点",
        "end":"结束结点",
        "task":"任务结点",
        fork:"分支结点",
        "join":"联合结点",
        group:"组织划分框编辑开关"
    };
    var demo;
    $(document).ready(function(){
        demo=$.createGooFlow($("#demo2"),property);
        demo.setNodeRemarks(remark);
        demo.loadData(jsondata);
    });
    var out;
    function Export(){
        document.getElementById("result").value=JSON.stringify(demo.exportData());
    }
</script>
</body>
</html>
